<?php /* Smarty version 2.6.18, created on 2012-02-17 00:44:09
         compiled from index/permission.tpl */ ?>
<?php require_once(SMARTY_CORE_DIR . 'core.load_plugins.php');
smarty_core_load_plugins(array('plugins' => array(array('function', 'cycle', 'index/permission.tpl', 38, false),array('function', 'pow', 'index/permission.tpl', 47, false),)), $this); ?>
<?php $_smarty_tpl_vars = $this->_tpl_vars;
$this->_smarty_include(array('smarty_include_tpl_file' => "common/header.tpl", 'smarty_include_vars' => array()));
$this->_tpl_vars = $_smarty_tpl_vars;
unset($_smarty_tpl_vars);
 ?>
<?php if ($this->_tpl_vars['AppUI']->id <= 0): ?>
	<?php $_smarty_tpl_vars = $this->_tpl_vars;
$this->_smarty_include(array('smarty_include_tpl_file' => "index/login.tpl", 'smarty_include_vars' => array()));
$this->_tpl_vars = $_smarty_tpl_vars;
unset($_smarty_tpl_vars);
 ?>  
<?php else: ?>
	<?php $_smarty_tpl_vars = $this->_tpl_vars;
$this->_smarty_include(array('smarty_include_tpl_file' => "common/menu.tpl", 'smarty_include_vars' => array()));
$this->_tpl_vars = $_smarty_tpl_vars;
unset($_smarty_tpl_vars);
 ?>
    <div class="rightColumn">
    	<div class="boxContent">
        	<div class="contentItem">
                <div class="contentItems">
                	<div class="headerTitle"><h2><a href="<?php echo @HOST_BACKEND; ?>
index/list">Thành viên Ban Quản Trị</a> &raquo; Phân quyền thành viên <?php echo $this->_tpl_vars['arrInfo']->username; ?>
</h2></div>
                    <div class="secData">
                    	<form id="frmPermission" name="frmPermission" method="post" action="<?php echo @HOST_BACKEND; ?>
index/saveperm" enctype="multipart/form-data">
                        	<input type="hidden" name="padminid" id="padminid" value="<?php echo $this->_tpl_vars['arrInfo']->id; ?>
" />
                            <input type="hidden" name="pusername" id="pusername" value="<?php echo $this->_tpl_vars['arrInfo']->username; ?>
" />
                        	<?php if ($this->_tpl_vars['arrAPerm']): ?>
                                <div class="secActionAndPage">
                                    <div class="actionLink">
                                    	<?php if (isset ( $_SESSION['admin'] )): ?>
                                            <?php if (( $_SESSION['admin'] & 1 << 2 ) > 0): ?>  
                                                <input type="button" value="Lưu phân quyền" class="btnLarge" onclick="javascript:savePermission(this.form)"/>
                                            <?php endif; ?>
                                       	<?php else: ?>
                                        	&nbsp;
                                        <?php endif; ?>
                                    </div>
                                </div>
                            <?php endif; ?>
                            <table width="100%" cellpadding="0" cellspacing="0" border="0">
                                <thead>
                                    <tr>
                                        <th>Loại danh mục</th>
                                        <th width="80%">Phân quyền</th>
                                    </tr>
                                </thead>
                                <tbody>
                                	<?php if ($this->_tpl_vars['arrAPerm']): ?>
                                        <?php $_from = $this->_tpl_vars['arrAPerm']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['item']):
?>
	                                        <tr class="<?php echo smarty_function_cycle(array('values' => "odd,even"), $this);?>
">
                                            	<td><label for="pPerm6_<?php echo $this->_tpl_vars['item']['sectionid']; ?>
" style="width:100%;"><?php echo $this->_tpl_vars['item']['name']; ?>
</label></td>
                                                <td>
                                                	<div class="chkPerm">
                                                    	<!--check all-->
                                                        <input type="checkbox" id="pPerm6_<?php echo $this->_tpl_vars['item']['sectionid']; ?>
" class="chkPerm" onclick="javascript:checkAllPerm(this,'<?php echo $this->_tpl_vars['item']['sectionid']; ?>
')" <?php if (( ( $this->_tpl_vars['item']['perm'] & 1 << 0 ) > 0 ) && ( ( $this->_tpl_vars['item']['perm'] & 1 << 1 ) > 0 ) && ( ( $this->_tpl_vars['item']['perm'] & 1 << 2 ) > 0 ) && ( ( $this->_tpl_vars['item']['perm'] & 1 << 3 ) > 0 ) && ( ( $this->_tpl_vars['item']['perm'] & 1 << 4 ) > 0 ) && ( ( $this->_tpl_vars['item']['perm'] & 1 << 5 ) > 0 )): ?>checked="checked"<?php endif; ?>/>
                                                        <label for="pPerm6_<?php echo $this->_tpl_vars['item']['sectionid']; ?>
" class="chkPerm">Tất cả</label>
                                                    </div>
                                                    <div class="chkPerm">
                                                        <input type="checkbox" name="pPerm<?php echo $this->_tpl_vars['item']['sectionid']; ?>
[]" id="pPerm0_<?php echo $this->_tpl_vars['item']['sectionid']; ?>
" value="<?php echo smarty_function_pow(array('x' => 2,'y' => 0), $this);?>
" class="chkPerm" onclick="javascript:uncheckAllPerm(this,'<?php echo $this->_tpl_vars['item']['sectionid']; ?>
')" <?php if (( $this->_tpl_vars['item']['perm'] & 1 << 0 ) > 0): ?>checked="checked"<?php endif; ?>/>
                                                        <label for="pPerm0_<?php echo $this->_tpl_vars['item']['sectionid']; ?>
" class="chkPerm">Chỉ được xem</label>
                                                   	</div>
                                                    <div class="chkPerm">
                                                        <!--them moi-->
                                                        <input type="checkbox" name="pPerm<?php echo $this->_tpl_vars['item']['sectionid']; ?>
[]" id="pPerm1_<?php echo $this->_tpl_vars['item']['sectionid']; ?>
" value="<?php echo smarty_function_pow(array('x' => 2,'y' => 1), $this);?>
" class="chkPerm" onclick="javascript:uncheckAllPerm(this,'<?php echo $this->_tpl_vars['item']['sectionid']; ?>
')" <?php if (( $this->_tpl_vars['item']['perm'] & 1 << 1 ) > 0): ?>checked="checked"<?php endif; ?>/>
                                                        <label for="pPerm1_<?php echo $this->_tpl_vars['item']['sectionid']; ?>
" class="chkPerm">Thêm mới</label>
                                                   	</div>
                                                    <div class="chkPerm">
                                                        <!--cap nhat-->
                                                        <input type="checkbox" name="pPerm<?php echo $this->_tpl_vars['item']['sectionid']; ?>
[]" id="pPerm2_<?php echo $this->_tpl_vars['item']['sectionid']; ?>
" value="<?php echo smarty_function_pow(array('x' => 2,'y' => 2), $this);?>
" class="chkPerm" onclick="javascript:uncheckAllPerm(this,'<?php echo $this->_tpl_vars['item']['sectionid']; ?>
')" <?php if (( $this->_tpl_vars['item']['perm'] & 1 << 2 ) > 0): ?>checked="checked"<?php endif; ?>/>
                                                        <label for="pPerm2_<?php echo $this->_tpl_vars['item']['sectionid']; ?>
" class="chkPerm">Cập nhật</label>
                                                   	</div>
                                                    <div class="chkPerm">
                                                        <!--xoa-->
                                                        <input type="checkbox" name="pPerm<?php echo $this->_tpl_vars['item']['sectionid']; ?>
[]" id="pPerm3_<?php echo $this->_tpl_vars['item']['sectionid']; ?>
" value="<?php echo smarty_function_pow(array('x' => 2,'y' => 3), $this);?>
" class="chkPerm" onclick="javascript:uncheckAllPerm(this,'<?php echo $this->_tpl_vars['item']['sectionid']; ?>
')" <?php if (( $this->_tpl_vars['item']['perm'] & 1 << 3 ) > 0): ?>checked="checked"<?php endif; ?>/>
                                                        <label for="pPerm3_<?php echo $this->_tpl_vars['item']['sectionid']; ?>
" class="chkPerm">Xóa</label>
                                                   	</div>
                                                    <div class="chkPerm">
                                                        <!--tam dung-->
                                                        <input type="checkbox" name="pPerm<?php echo $this->_tpl_vars['item']['sectionid']; ?>
[]" id="pPerm4_<?php echo $this->_tpl_vars['item']['sectionid']; ?>
" value="<?php echo smarty_function_pow(array('x' => 2,'y' => 4), $this);?>
" class="chkPerm" onclick="javascript:uncheckAllPerm(this,'<?php echo $this->_tpl_vars['item']['sectionid']; ?>
')" <?php if (( $this->_tpl_vars['item']['perm'] & 1 << 4 ) > 0): ?>checked="checked"<?php endif; ?>/>
                                                        <label for="pPerm4_<?php echo $this->_tpl_vars['item']['sectionid']; ?>
" class="chkPerm">Tạm dừng</label>
                                                   	</div>
                                                    <div class="chkPerm">
                                                        <!--kich hoat/phuc hoi-->
                                                        <input type="checkbox" name="pPerm<?php echo $this->_tpl_vars['item']['sectionid']; ?>
[]" id="pPerm5_<?php echo $this->_tpl_vars['item']['sectionid']; ?>
" value="<?php echo smarty_function_pow(array('x' => 2,'y' => 5), $this);?>
" class="chkPerm" onclick="javascript:uncheckAllPerm(this,'<?php echo $this->_tpl_vars['item']['sectionid']; ?>
')" <?php if (( $this->_tpl_vars['item']['perm'] & 1 << 5 ) > 0): ?>checked="checked"<?php endif; ?>/>
                                                        <label for="pPerm5_<?php echo $this->_tpl_vars['item']['sectionid']; ?>
" class="chkPerm">Kích hoạt / phục hồi</label>
                                                   	</div>
                                                </td>
                                            </tr>
                                        <?php endforeach; endif; unset($_from); ?>
                                   	<?php endif; ?>
                                </tbody>
                            </table>
                            <?php if ($this->_tpl_vars['arrAPerm']): ?>
                                <div class="secActionAndPage">
                                    <div class="actionLink">
                                    	<?php if (isset ( $_SESSION['admin'] )): ?>
                                            <?php if (( $_SESSION['admin'] & 1 << 2 ) > 0): ?>  
                                                <input type="button" value="Lưu phân quyền" class="btnLarge" onclick="javascript:savePermission(this.form)"/>
                                            <?php endif; ?>
                                       	<?php else: ?>
                                        	&nbsp;
                                        <?php endif; ?>
                                    </div>
                                </div>
                            <?php endif; ?>
                      	</form>
                   	</div>
                </div>
          	</div>
        </div>
    </div>
<?php endif; ?>
<?php $_smarty_tpl_vars = $this->_tpl_vars;
$this->_smarty_include(array('smarty_include_tpl_file' => "common/footer.tpl", 'smarty_include_vars' => array()));
$this->_tpl_vars = $_smarty_tpl_vars;
unset($_smarty_tpl_vars);
 ?>
                